cmake_minimum_required(VERSION 3.4.1)

# 设置生成的so动态库最后输出的路径
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/../jniLibs/${ANDROID_ABI})

#设置头文件搜索路径（和此txt同个路径的头文件无需设置），可选
include_directories()

file(GLOB jni "*.cpp")

add_library( # Sets the name of the library.  设置库的名称。
             Demo

             # Sets the library as a shared library. 将library设置为一个共享库
             SHARED

             # Provides a relative path to your source file(s).为源文件提供一个相对路径
                ${jni}
             )


find_library( # Sets the name of the path variable. 设置路径变量的名称
              log-lib

              # Specifies the name of the NDK library that 指定NDK库的名称
              # you want CMake to locate.
              log
              )


target_link_libraries( # Specifies the target library.指定目标library中。
                       Demo

                       # Links the target library to the log library  将目标library链接到日志库
                       # included in the NDK.
                       ${log-lib}
                       )
